def writer(file_path, lst2d):
    with open(file_path, "w") as file:
        for sub_lst in lst2d:
            file.write(",".join(sub_lst))
            file.write('\n')


def read(file_path):
    lst2d = []
    with open(file_path) as file:
        lst = file.readlines()
        # print(type(lst), ",", lst)
        for item in lst:
            item = item[:-len('\n')]
            # item = item.removesuffix('\n')
            sub_list = item.split(",")
            lst2d.append(sub_list)
    print(lst2d)


if __name__ == '__main__':
    writer("list2d.txt", [["1", "2", "3"], ["a", "b", "c"], ["你", "我", "他"]])
    read("list2d.txt")
